﻿using System;
using System.Linq;

class Program
{
    static void Main()
    {
        Random random = new Random();
        int[] numbers = new int[100];

        for (int i = 0; i < numbers.Length; i++)
        {
            numbers[i] = random.Next(0, 1001);
        }

        Console.WriteLine("随机生成的整数：");
        foreach (int number in numbers)
        {
            Console.WriteLine(number);
        }

        var sortedNumbers = numbers.OrderByDescending(n => n);
        int sum = sortedNumbers.Sum();
        double average = sortedNumbers.Average();

        Console.WriteLine("排序后的整数：");
        foreach (int number in sortedNumbers)
        {
            Console.WriteLine(number);
        }

        Console.WriteLine("整数的和：" + sum);
        Console.WriteLine("整数的平均数：" + average);

        Console.ReadLine();
    }
}
